package com.jungle.mvvm.sample.util;

import com.jungle.mvvm.utils.SPUtils;
import com.jungle.mvvm.utils.StringUtils;

/**
 * @ClassName LoginUtil
 * @Description 登录工具类
 * @Author Daniel
 * @Version V1.0.0
 */
public class LoginUtil {

    private LoginUtil() {
        throw new UnsupportedOperationException("u can't instantiate me...");
    }

    public static boolean hasLogined() {
        String userId = SPUtils.getInstance().getString("userId");
        return !StringUtils.isTrimEmpty(userId);
    }

    public static void clearLogin() {
        SPUtils.getInstance().clear();
    }
}
